# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=voltron
pkgver=629.be9e54b
pkgrel=1
pkgdesc="UI for GDB, LLDB and Vivisect's VDB."
groups=('blackarch' 'blackarch-debugger')
arch=('any')
url='https://github.com/snare/voltron'
license=('MIT')
depends=('python' 'python-pygments' 'python-blessed' 'python-flask'
         'python-flask-restful' 'python-requests-unixsocket' 'python-argparse'
         'python-scruffy' 'python-pysigset' 'python-pexpect' 'python-requests'
         'python-werkzeug' 'python-six' 'python-mock' 'python-nose'
         'python-scruffington')
makedepends=('git' 'python-setuptools')
optdepends=('gdb: GDB' 'lldb: LLDB' 'vivisect: VDB')
source=("git+https://github.com/snare/$pkgname.git"
        "git+https://github.com/snare/$pkgname.wiki")
sha512sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|scruffington>=0.3.6|scruffington|g' setup.py
  sed -i '/async = True$/d' voltron/plugins/view/memory.py
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  cp -a "$srcdir/$pkgname.wiki" "$pkgdir/usr/share/doc/$pkgname/"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

